package com.foreveross.fetl.core.domain.freight;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.foreveross.fetl.common.domain.BaseEntity;

@Entity
@Table(name="freight_price")
public class FreightPrice extends BaseEntity{

	/*
	 * 
DROP TABLE IF EXISTS `freight_price`;
CREATE TABLE `freight_price` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
	`rowkey` varchar(50) DEFAULT NULL COMMENT 'rowkey',
`type` int COMMENT '2表示价差预警;3表示竞争对比预警',
  `fromCity` varchar(3) DEFAULT NULL COMMENT '起点（三字码）',
  `toCity` varchar(3) DEFAULT NULL COMMENT '终点三字码',
  `fromCityName` varchar(20) DEFAULT NULL COMMENT '起点',
  `toCityName` varchar(20) DEFAULT NULL COMMENT '终点',
`flightNo` varchar(20) DEFAULT NULL COMMENT '航班号',
	`flightDate` date DEFAULT NULL COMMENT '航班日期',
	`grabDate` date DEFAULT NULL COMMENT '抓取日期',
	`grabChannel` varchar(10) DEFAULT NULL COMMENT '渠道',
`grabChannelKey` VARCHAR(5) COMMENT '渠道码（如南航：20005）',
`cabinLevel` VARCHAR(20) COMMENT '仓位级别',
`price` DOUBLE COMMENT '价格',
	`compareGrabChannel` varchar(10) DEFAULT NULL COMMENT '比较的渠道',
`compareGrabChannelKey` VARCHAR(5) COMMENT '渠道码（如南航：20005）',
`comparePrice` DOUBLE COMMENT '比较渠道的价格',
`compareCabinLevel` VARCHAR(20) COMMENT '比较渠道仓位级别',
`compareFlightNo` VARCHAR(20) COMMENT '比较渠道航班',
	`priceRatio` DOUBLE DEFAULT NULL COMMENT '价差比',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='价差';


渠道 比较渠道 起点 终点 抓取时间 航班日期 航班号 比较渠道航班号 5位随机数  
5      5      3   3   年月日8 年月日8   8           8        5
	 */
	private static final long serialVersionUID = 8598528225370759816L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	@Column private String rowkey;
	@Column private int type;
	@Column private String fromCity;
	@Column private String fromCityName;
	@Column private String toCity;
	@Column private String toCityName;
	@Column private String grabChannel;
	@Column private String grabChannelKey;
	@Column private Double price;
	@Column private String cabinLevel;
	@Column private String compareCabinLevel;
	@Column private String compareGrabChannel;
	@Column private String compareGrabChannelKey;
	@Column private Double comparePrice; 
	@Column private String flightNo;
	@Column private String compareFlightNo;
	@Column private Date grabDate;
	@Column private Date flightDate;
	@Column private Double priceRatio;
	
	
	public FreightPrice() {
		super();
	}

	public FreightPrice(String rowkey, int type,String fromCity, String fromCityName,
			String toCity, String toCityName, String grabChannel,
			String grabChannelKey, Double price, String cabinLevel,
			String compareCabinLevel, String compareGrabChannel,
			String compareGrabChannelKey, Double comparePrice, String flightNo,
			String compareFlightNo, Date grabDate, Date flightDate,
			Double priceRatio) {
		super();
		this.rowkey = rowkey;
		this.type = type;
		this.fromCity = fromCity;
		this.fromCityName = fromCityName;
		this.toCity = toCity;
		this.toCityName = toCityName;
		this.grabChannel = grabChannel;
		this.grabChannelKey = grabChannelKey;
		this.price = price;
		this.cabinLevel = cabinLevel;
		this.compareCabinLevel = compareCabinLevel;
		this.compareGrabChannel = compareGrabChannel;
		this.compareGrabChannelKey = compareGrabChannelKey;
		this.comparePrice = comparePrice;
		this.flightNo = flightNo;
		this.compareFlightNo = compareFlightNo;
		this.grabDate = grabDate;
		this.flightDate = flightDate;
		this.priceRatio = priceRatio;
	}
	
	public FreightPrice(String rowkey,int type, String fromCity, String fromCityName,
			String toCity, String toCityName, String grabChannel,
			String grabChannelKey, Double price, String compareGrabChannel,
			String compareGrabChannelKey, Double comparePrice, String flightNo,
			Date grabDate, Date flightDate, Double priceRatio) {
		super();
		this.rowkey = rowkey;
		this.type = type;
		this.fromCity = fromCity;
		this.fromCityName = fromCityName;
		this.toCity = toCity;
		this.toCityName = toCityName;
		this.grabChannel = grabChannel;
		this.grabChannelKey = grabChannelKey;
		this.price = price;
		this.compareGrabChannel = compareGrabChannel;
		this.compareGrabChannelKey = compareGrabChannelKey;
		this.comparePrice = comparePrice;
		this.flightNo = flightNo;
		this.grabDate = grabDate;
		this.flightDate = flightDate;
		this.priceRatio = priceRatio;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getRowkey() {
		return rowkey;
	}
	public void setRowkey(String rowkey) {
		this.rowkey = rowkey;
	}
	public String getCompareFlightNo() {
		return compareFlightNo;
	}
	public void setCompareFlightNo(String compareFlightNo) {
		this.compareFlightNo = compareFlightNo;
	}
	public String getCabinLevel() {
		return cabinLevel;
	}
	public void setCabinLevel(String cabinLevel) {
		this.cabinLevel = cabinLevel;
	}
	public String getCompareCabinLevel() {
		return compareCabinLevel;
	}
	public void setCompareCabinLevel(String compareCabinLevel) {
		this.compareCabinLevel = compareCabinLevel;
	}
	public String getCompareGrabChannel() {
		return compareGrabChannel;
	}
	public void setCompareGrabChannel(String compareGrabChannel) {
		this.compareGrabChannel = compareGrabChannel;
	}
	public String getCompareGrabChannelKey() {
		return compareGrabChannelKey;
	}
	public void setCompareGrabChannelKey(String compareGrabChannelKey) {
		this.compareGrabChannelKey = compareGrabChannelKey;
	}
	public Double getComparePrice() {
		return comparePrice;
	}
	public void setComparePrice(Double comparePrice) {
		this.comparePrice = comparePrice;
	}
	public Date getFlightDate() {
		return flightDate;
	}
	public void setFlightDate(Date flightDate) {
		this.flightDate = flightDate;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getFromCity() {
		return fromCity;
	}
	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}
	public String getFromCityName() {
		return fromCityName;
	}
	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}
	public String getToCity() {
		return toCity;
	}
	public void setToCity(String toCity) {
		this.toCity = toCity;
	}
	public String getToCityName() {
		return toCityName;
	}
	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}
	public String getGrabChannel() {
		return grabChannel;
	}
	public void setGrabChannel(String grabChannel) {
		this.grabChannel = grabChannel;
	}
	public String getGrabChannelKey() {
		return grabChannelKey;
	}
	public void setGrabChannelKey(String grabChannelKey) {
		this.grabChannelKey = grabChannelKey;
	}
	public Double getPrice() {
		return price;
	}
	public void setPrice(Double price) {
		this.price = price;
	}
	public String getFlightNo() {
		return flightNo;
	}
	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}
	public Date getGrabDate() {
		return grabDate;
	}
	public void setGrabDate(Date grabDate) {
		this.grabDate = grabDate;
	}
	public Double getPriceRatio() {
		return priceRatio;
	}
	public void setPriceRatio(Double priceRatio) {
		this.priceRatio = priceRatio;
	}
}
